/**
 * @ClassName: Solution
 * @Author: qjc
 * @Date: 2023/9/14 12:15
 */
public class Solution {

    // n以内的素数
    public static int sushu(int n) {
        int count = 0;
        if (n != 0 & n != 1) {
            for (int i = 2; i <= n; i++) {
                count += isSuShu(i) ? 1 : 0;
            }
        }
        return count;
    }

    private static boolean isSuShu(int num) {
        for (int j = 2; j * j <= num; j++) {
            if (num != j && num % j == 0) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        System.out.println(sushu(100));
    }

}
